Repository navigation
opencode-config-normalize: preserve comments in the plugin+plugins merge (#4639) - #4644
Conversation
…array comments (#4639) The both-present merge re-serialised the merged array with json.dumps, silently deleting every comment inside both arrays while reporting success. Splice the legacy elements into the plugins array as text (legacy first, native appended) and drop the v1 entry, so comments survive byte-identical. Shapes that cannot be spliced comment-safely (e.g. a // comment trailing the last legacy element) fail closed with exit 1 and the file byte-identical. Regression fixtures: both-present merge with comments in both arrays (comments asserted byte-present), plus the fail-closed boundary case.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 14 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. CodeRabbit Verify
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…ueue/6575-4639-plugin-comments
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7b07a6c087
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Pushed update addressing the Codex P2 finding: the splice now strips a trailing element comma hidden behind trailing block comments (e.g. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a2fe52bac6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Fixes #4639.
The both-present
plugin+pluginsmerge re-serialised the merged array withjson.dumps, silently deleting every comment inside both arrays while exiting 0. The pre-write verification compared comment-stripped parses, so the loss verified as correct.This changes the merge to a textual element splice (legacy elements first, native appended, v1 entry dropped) so in-array comments survive byte-identical. Shapes that cannot be spliced comment-safely (e.g. a
//comment trailing the last legacy element, which would swallow the joining comma) fail closed: exit 1 with the file byte-identical.Scope is the both-present merge plus the regression fixture only; the #4612 agent fold and #3180 permissions behaviour are untouched.
Verification
bash pkgs/opencode-config-normalize/normalize_test.sh— all 15 cases pass, including new case 14 (both-present merge with comments in both arrays, comments asserted byte-present) and case 15 (fail-closed boundary, exit 1 + byte-identical)./* legacy note */,// native note,// trailing native) now repairs with all three comments preserved; second run is a byte-identical no-op.//inside string values and inside block comments (no fail-closed misfire), reversed key order.Agent: repo-worker-code (OpenChamber scheduled lane) · task 6575
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.